package eighteen;

/**
 * @author zzb
 * @since 2021-01-14
 */
public class Test {
  public static void main(String[] args) {
    Originator org = new Originator();
    org.setState("开会中");
    Caretaker ctk = new Caretaker();
    ctk.setMemento(org.createMemento());//将数据封装在 Caretaker
    org.setState("睡觉中");
    org.showState();//睡觉中
    org.setMemento(ctk.getMemento());//将数据重新导入
    org.showState();//开会中,上次保存的
  }
}
